package Gamewudao;

import java.util.Scanner;

public class Player {
    private int levelNo;//玩家级别号
    private int currScore;//积分
    private long startTime=0;//当前级别开始时间
    private int elapsedTime;//当前级别已用时间
    Game game;

    public int getLevelNo() {
        return levelNo;
    }

    public void setLevelNo(int levelNo) {
        this.levelNo = levelNo;
    }

    public int getCurrScore() {
        return currScore;
    }

    public void setCurrScore(int currScore) {
        this.currScore = currScore;
    }

    public long getStartTime() {
        return startTime;
    }

    public void setStartTime(long startTime) {
        this.startTime = startTime;
    }

    public int getElapsedTime() {
        return elapsedTime;
    }

    public void setElapsedTime(int elapsedTime) {
        this.elapsedTime = elapsedTime;
    }

    public Game getGame() {
        return game;
    }

    public void setGame(Game game) {
        this.game = game;
    }
    //玩家玩游戏
    public void play(){
        //创建游戏实例
        Game game=new Game(this);
        Scanner input=new Scanner(System.in);
        for (int i=0;i<LevelParam.levels.length;i++){
            this.levelNo+=1;
            this.startTime=System.currentTimeMillis();//系统当前时间
            this.currScore=0;
            for (int j=0;j<LevelParam.levels[levelNo-1].getStrTimes();j++){
                String outstr=game.printStr();
                String instr=input.next();
                game.printResult(outstr,instr);

            }

        }

    }

}
